#pragma once
#include "../TermEngine/TermSet.h"
#include "../Math/EvaluatingFunction.h"



class GeneSet : public EvaluatingTermSet {

public:
	const Type*  Ty_Boolean;
	const Type*  Ty_Number;

	ArrowType* Arity1Function;
	ArrowType* Arity2Function;
	ArrowType* Predicate;
	ArrowType* BinaryRelation;

	const Token* Te_False;
	const Token* Te_True;
	const Token* Te_ifBool;	
	const Token* Te_ifNumber;

	const Token* Te_And;
	const Token* Te_Not;
	const Token* Te_Or;

	const Token* Var1;
	Term::pointer Var2;

	
	const Token*  Te_Plus;
	const Token*  Te_Minus;
	const Token*  Te_Mult;
	const Token*  Te_Div;

	const Token* Te_Gt;
	FreeTermVariable*  Te_St;
	FreeTermVariable*  Te_Eq;
	FreeTermVariable*  Te_Slope;
	vector<const Token*> Constants;

	
protected:
	virtual void initBaseTypes( void ) { };
	void initNumbers();
	virtual void initBooleans( void ) { };
	virtual void initBooleanOperators( void ) { };
	void initBinaryFunctions( );

public:
	GeneSet( void );
	virtual void initGenes( );
	virtual ~GeneSet(void);

public:
	Term* preEval( const ApplicationTerm& AT ) const;

	virtual SemanticEvaluation evalDefinedOp(const ApplicationTerm& ) const;
	virtual SemanticEvaluation* GeneSet::eval(const Term*) const;

protected:
	const SemanticEvaluation* getValue (const Term*) const;

public:
	const Token* insert(Token::const_reference);

	};

class NoAbstractionGeneSet : public GeneSet{

protected:
	void initBaseTypes( void );
	void initBooleans( void );
	void initBooleanOperators( void );

public:
	virtual bool isDefinedOp( const ApplicationTerm& ) const;	
	};

class LAbstractionGeneSet : public NoAbstractionGeneSet{
protected:
	void initBooleans( void );
	void initBooleanOperators( void );
	};

class LTAbstractionGeneSet : public LAbstractionGeneSet{

protected:
	void initBaseTypes( void );
	void initBooleans( void );
	};




 


